#include<stdio.h>
#include "Base64.h"

#pragma warning(disable : 4996)

const char * strFileIn = "text1.txt";
const char * strFileOut = "text2.JPG";
//const char * coding = "coding.txt";
const int mode = 1; // 0 - encode, 1 = decode

int main(int argc, char * argv[]){
	FILE *pFile1, *pFile2;
	pFile1 = fopen(strFileIn, mode ? "rt" : "rb");
	if (pFile1==NULL) {
		printf("Error1.\n");
		return 1;
	}
	pFile2 = fopen(strFileOut,mode ? "wb" : "wt");
	if (pFile2==NULL) {
		printf("Error2.\n");
		fclose(pFile1);
		return 1;
	}
	mode ? decode(pFile1,pFile2):encode(pFile1,pFile2);
	/*if (pFile2==NULL) {
		printf("Error.\n");
		return 1;
	}*/

	fclose(pFile1);
	fclose(pFile2);
	getchar();
	return 0;
}